package com.example.strategy.strategy.service.impl;


import com.example.strategy.strategy.enmus.RechargeTypeEnum;
import com.example.strategy.strategy.factory.StrategyFactory;
import com.example.strategy.strategy.service.Strategy;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class CardStrategy implements Strategy {

    @PostConstruct
    public void init(){
        StrategyFactory.register(RechargeTypeEnum.CARD_RECHARGE.value(), this);
    }
    public Double calRecharge(Double charge) {
        return charge*1.01;
    }
}
